/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, {Component} from 'react';
import {
    AppRegistry,
    StyleSheet,
    View,
    Image,
    TouchableOpacity,
} from 'react-native';
import Login from './Login';
export default class First extends Component {
    constructor(props) {
        super(props);
        this.state = {};
    }

    _pressButtoon() {
        const {navigator} = this.props;
        if (navigator) {
            navigator.push({
                name: 'Login',
                component: Login,
            })
        }
    }


    render() {
        let pic = {uri: 'http://bmob-cdn-9229.b0.upaiyun.com/2017/02/22/ac57e5b1403aadc4808de77b47b638a5.jpg'}
        let dimension = require('Dimensions');
        let totalWidth = dimension.get('window').width;
        let totalheight = dimension.get('window').height;
        return (
            <View style={{flex:1,flexDirection:'column',justifyContent:'flex-start'}}>
                <TouchableOpacity onPress={this._pressButtoon.bind(this)} style={{flex:6}} resizeMode={'stretch'}>
                    <Image source={pic} style={{flex:1}}/>
                </TouchableOpacity>
                <Image source={require('../src/icon.png')} style={{flex:1,width:totalWidth}}/>
            </View>
        );
    }
}
const styles = StyleSheet.create({
    container: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: '#F5FCFF',
    },
    imageStyle: {
        width: 193,
        height: 110
    }
});
